Generics Sample

Generics provide the tool to create flexible reusable code by allowing classes, structures, interfaces, methods and delegates to be declared as a generic type instead of an actual type; the actual type is specified later. The System.Collections.Generic namespace provides generic collection classes that make creating type safe collections very easy.

In this example we focus on the type safe collection classes and show how their type safety works and what the speed benefit is of using a generic collection over a standard collection.

This sample requires the following to be installed: